import type { PageDto, PageData, PutMutiDto, PutMutiRes, DisableDto, DisableRes } from "~/rest";

import { Gateway, getGateway } from "@/droplet-bus/core.define";

import { BayQuantifyGateway } from "./core.define";
import { TickGroup, TickMinute, TickSymbol } from "./schema.tick";

export const TickGroupGateway: Gateway = getGateway(BayQuantifyGateway, "river_quantify_tick_group");
export type getTickGroupDto = PageDto<TickGroup>;
export type putTickGroupDto = PutMutiDto<TickGroup>;
export type deleteTickGroupDto = DisableDto;

export interface TickGroupInterface<T> {
  get(dto: T & getTickGroupDto): Promise<PageData<TickGroup>>;
  put(dto: T & putTickGroupDto): Promise<PutMutiRes<TickGroup>>;
  delete(dto: T & deleteTickGroupDto): Promise<DisableRes>;
}

export const TickSymbolGateway: Gateway = getGateway(BayQuantifyGateway, "river_quantify_tick_symbol");
export type getTickSymbolDto = PageDto<TickSymbol>;
export type putTickSymbolDto = PutMutiDto<TickSymbol>;
export type deleteTickSymbolDto = DisableDto;

export interface TickSymbolInterface<T> {
  get(dto: T & getTickSymbolDto): Promise<PageData<TickSymbol>>;
  put(dto: T & putTickSymbolDto): Promise<PutMutiRes<TickSymbol>>;
  delete(dto: T & deleteTickSymbolDto): Promise<DisableRes>;
}

export const TickMinuteGateway: Gateway = getGateway(BayQuantifyGateway, "river_quantify_tick_minute");
export type getTickMinuteDto = PageDto<TickMinute>;
export type putTickMinuteDto = PutMutiDto<TickMinute>;

export interface TickMinuteInterface<T> {
  get(dto: T & getTickMinuteDto): Promise<PageData<TickMinute>>;
  put(dto: T & putTickMinuteDto): Promise<PutMutiRes<TickMinute>>;
}
